﻿@using ViewRes

@model DonutMgmtSystemFoundation.Models.GeneralJsonResultModel
@{
    Layout = "~/Views/Shared/_LoginLayout.cshtml";
}

@section Pagename{ 
    @LoginStrings.ActivateUser
}

@section Script{
    <script type="text/javascript">
        $(function () {
            window.setInterval(function () {
                var timeLeft = $("#timeLeft").html();
                if (eval(timeLeft) == 0) {
                    window.location = ("@Url.Action("Login", "Login")");
                } else {
                    var time = eval(timeLeft) - eval(1);
                    console.log(time);
                    $("#timeLeft").html(time);
                }
            }, 1000);
        });
    </script>
}

<div class="ui one column grid">
    <div class="column">
        <div class="ui fluid segment">
            <h1>@LoginStrings.ActivateUser</h1>
            @if (!Model.Success)
            {
                
                <div class="ui red message">@Model.Message</div>
                
            }
            else
            {
                <div class="ui success message">@Model.Message</div>
                <p>@LoginStrings.MsgRedirected1
                    <span style="color:red;" id="timeLeft">10</span> 
                    @LoginStrings.MsgRedirected2 @Html.ActionLink("link","Login","Login") 
                    </p>
            }
        </div>
    </div>
</div>

